/*
 * @Author: xiehangyun 
 * @Date: 2025-05-16 18:15:40 
 * @Last Modified by: 肖思汗
 * @Last Modified time: 2025-06-27 16:36:59
 */

import { makeAutoObservable } from "mobx";

class IndexStore {

    constructor() {
        makeAutoObservable(this, {}, { deep: false });
    }

    page = 1;//当前页面
    pageSize = 10;//分页数
    total = 0;//总数
    list: Array<any> = [];//数据列表
    //请求数据
    async getList(page: number = 1, pageSize: number = 10) {
        this.page = page;
        this.pageSize = pageSize;
        this.list = [];// 请求数据
    }
    //新增数据
    add(data: any) {
        // 新增完后请求数据
        this.getList();
    }
    //删除数据
    delete(id: string) {
        // 删除完后请求数据
        this.getList();
    }
    //更新数据
    updata(data: any) {
        // 更新完后请求数据
        this.getList();
    }

};

const indexStore = new IndexStore();

export default indexStore;